home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 6
/
The Arsenal Files 6 (Arsenal Computer).ISO
/
prg_basi
/
n_b-v200.zip
/
NB02
/
DMO
/
VLR-R&W.DMO
< prev
next >
Wrap
Text File
|
1996-03-11
|
3KB
|
53 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME VLR-R&W .DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "DAS-NB02.INC"
COLOR 7,0
CLS
? "┌────────────────────────────────────────────────────────────────────
? "│ VLRwrite1 ( FileNo%, D$ ) fVLRread1$( FileNo% )
? "│ VLRwrite2 ( FileNo%, D$ ) fVLRread2$( FileNo% )
? "├───────────────────────────────────────────────────────────────────────
? "│ The 1 and 2 in the names of these routines refer to the number of bytes
? "│ used to record the length of the data string. This style of storing data
? "│ is quite popular as it allows for very compact storage of data using a
? "│ BINARY file. It is really quite simple to use and understand and the
? "│ code below is quite explicit. The only thing you need remember is that
? "│ the 4 routines expect the file to be at the correct SEEK position when
? "│ they are called.
? "│ NOTE: VLRwrite1 and fVLRread1$ work on strings up to a length of 255
? "│ VLRwrite2 and fVLRread2$ work on strings up to 32k in length
? "└────────────────────────────────────────────────────────────────────────
? '┌────────────────────────
F$ = "DUMMY.DAT" '│ a junk file
F% = FREEFILE '│
D$ = "DASoft Libraries" '│ some variables
P$ = "PowerBASIC" '│
'│
OPEN "B", #F%, F$ '│ open the file
VLRwrite1 F%, D$ '│ notice the "sequential"
VLRwrite2 F%, P$ '│ style of writing &
SEEK #F%, 0 '│ reading data
PRINT fVLRread1$( F% ) '│
PRINT fVLRread2$( F% ) '│
CLOSE #1 '│ close the file
fKILLfile F$ '│ keep your HD clean!